﻿<Window x:Class="TFSTools.TestManagement.TestCaseReview.WorkItemTestView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WorkItemTestView" Height="300" Width="558">
    <Grid Margin="10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="2*" />
            <ColumnDefinition />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="35" />
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Margin="3" HorizontalAlignment="Right" VerticalAlignment="Center">ID:</TextBlock>
        <TextBox Grid.Row="0" Grid.Column="1" x:Name="txtWorkItemId" Height="25"></TextBox>
        <Button Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Content="Lookup" Margin="3" Width="70" HorizontalAlignment="Left" Click="LookupButton_Click"></Button>
        
        <Label x:Name="lblIdAndTitle" Grid.Row="1" Grid.ColumnSpan="4" VerticalAlignment="Center" Content="1234:  Test"></Label>

        <TextBlock Grid.Row="2" Grid.Column="0" Margin="3" HorizontalAlignment="Right" VerticalAlignment="Center">State:</TextBlock>

        <ComboBox Grid.Row="2" Grid.Column="1" Height="25" 
                        ItemsSource="{Binding Path=AvailableStates, Mode=OneWay}"
                        SelectedItem="{Binding Path=State, Mode=TwoWay}" IsEditable="True">
        </ComboBox>
        
        <TextBlock Grid.Row="2" Grid.Column="2" Margin="3" HorizontalAlignment="Right" VerticalAlignment="Center">Reason:</TextBlock>

        <TextBox Grid.Row="2" Grid.Column="4" Height="25" IsReadOnly="True" Text="{Binding Path=Reason, Mode=OneWay}"
                 Visibility="{Binding Path=IsStateTheSame, Converter={StaticResource BoolToVisConverter} }"></TextBox>
        <ComboBox Grid.Row="2" Grid.Column="4" Height="25" 
                        ItemsSource="{Binding Path=AvailableReasons, Mode=OneWay}"
                        SelectedItem="{Binding Path=Reason, Mode=TwoWay}"
                  Visibility="{Binding Path=IsStateChanged, Converter={StaticResource BoolToVisConverter} }" IsEditable="True">
        </ComboBox>

        <TextBlock Grid.Row="3" Grid.Column="0" Margin="3" HorizontalAlignment="Right" VerticalAlignment="Center">Assigned To:</TextBlock>

        <ComboBox Grid.Row="3" Grid.Column="1" Height="25" IsEditable="True"
                        ItemsSource="{Binding Path=UserNames, Mode=OneWay}"
                        SelectedItem="{Binding Path=AssignedTo, Mode=TwoWay}">
        </ComboBox>

        <StackPanel Grid.Row="3" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Margin="3" Width="70" Click="SaveButton_Click">Save</Button>
            <Button Margin="3" Width="70" Click="ExitButton_Click">Exit</Button>
        </StackPanel>
    </Grid>
</Window>
